﻿@model WebExtras.DemoApp.Models.Mvc.CoreFormViewModel

@{
  ViewBag.Title = "Mvc Gumby Form Helper Extensions";
}

<h3 class="keep-center">Mvc Gumby Form Helper Extensions</h3>

<div class="row">
  <div class="six columns">
    <div class="row">
      <div class="three columns">
        <strong>Assembly</strong>
      </div>
      <div class="four columns">
        WebExtras.Mvc.dll
      </div>
    </div>
    <div class="row">
      <div class="three columns">
        <strong>Namespace</strong>
      </div>
      <div class="four columns">
        WebExtras.Mvc.Gumby
      </div>
    </div>
  </div>
  <div class="six columns">
    <div class="three columns">
      <strong>Dependancies</strong>
    </div>
    <div class="six columns">
      <ul class="dependancies">
        <li>Appropriate third party libraries</li>
        <li>Gumby 2.5.x</li>
        <li>webextras.gumby.css</li>
      </ul>
    </div>
  </div>
</div>

<div class="well">
  <h4>Creating special buttons</h4>
  <p>Special buttons can be created by decorating hyperlinks and basic buttons with the appropriate special button type</p>

  <p>Markup</p>
  <pre><code>
  @@Html.Hyperlink("Take me to google", "http://www.google.com")
    .AsButton(EGumbyButton.Default)
  @@Html.Button(EButton.Regular, "Take me to google", "window.location='http://www.google.com.au'")
    .AsButton(EGumbyButton.Info, EGumbyButtonStyle.Large)
  </code></pre>
   @{
    const string msg = "You can create a button of type <strong>EButton.Cancel</strong> which takes you back to the previous page. When a button of this" +
                       "type is created, any onclick event specified will be blatantly ignored.";
  }
  @Html.Alert(EMessage.Warning, msg, string.Empty, EGumbyIcon.Flag)
  <p>Output</p>
  <div class="content">
    <p>
      @Html.Hyperlink("Take me to google", "http://www.google.com").AsButton(EGumbyButton.Default)
      @Html.Hyperlink("Take me to google", "http://www.google.com").AsButton(EGumbyButton.Primary)
      @Html.Button(EButton.Cancel, "Take me back").AsButton(EGumbyButton.Danger)
    </p>
    <p>
      @Html.Hyperlink("Take me to google", "http://www.google.com").AsButton(EGumbyButton.Info, EGumbyButtonStyle.Large)
      @Html.Hyperlink("Take me to google", "http://www.google.com").AsButton(EGumbyButton.Warning, EGumbyButtonStyle.Oval)
      @Html.Button(EButton.Regular, "Take me to google", "goToGoogle()").AsButton(EGumbyButton.Secondary, EGumbyButtonStyle.Pill_Left)
    </p>
  </div>
  <p>All available extensions</p>
  <pre><code>
  .AsButton(type)
  .AsButton(type, size/style)
  </code></pre>
  @Html.Alert(EMessage.Warning, "Note that this extension can only be used for hyperlinks and button elements", string.Empty, EGumbyIcon.Flag)
</div>